package com.seguriapp.common.gwt.client.searchfilter;

import java.util.Date;

import com.google.gwt.event.shared.GwtEvent;

public class SearchFilterAppliedEvent extends GwtEvent<SearchFilterAppliedEventHandler> {

  public static final Type<SearchFilterAppliedEventHandler> TYPE = new Type<SearchFilterAppliedEventHandler>();

  private final Date startDate;
  private final Date endDate;
  private final String names;
  private final double latitude;
  private final double longitude;
  private final int distance;
  private final long policeStationId;
  private final boolean searchByPolStation;

  public SearchFilterAppliedEvent(final Date startDate, final Date endDate, final String names, final double latitude, final double longitude,
      final int distance, final long pStationId, final boolean searchByPolStation) {
    this.startDate = startDate;
    this.endDate = endDate;
    this.names = names;
    this.latitude = latitude;
    this.longitude = longitude;
    this.distance = distance;
    this.policeStationId = pStationId;
    this.searchByPolStation = searchByPolStation;
  }

  @Override
  public GwtEvent.Type<SearchFilterAppliedEventHandler> getAssociatedType() {
    return TYPE;
  }

  @Override
  protected void dispatch(final SearchFilterAppliedEventHandler handler) {
    handler.onSearchFilterApplied(this);
  }

  public static Type<SearchFilterAppliedEventHandler> getType() {
    return TYPE;
  }

  public Date getStartDate() {
    return startDate;
  }

  public Date getEndDate() {
    return endDate;
  }

  public String getNames() {
    return names;
  }

  public double getLatitude() {
    return latitude;
  }

  public double getLongitude() {
    return longitude;
  }

  public int getDistance() {
    return distance;
  }

  public long getPoliceStationId() {
    return policeStationId;
  }

  public boolean isSearchByPolStation() {
    return searchByPolStation;
  }

}
